from typing import List


class Solution:
    def addRungs(self, rungs: List[int], dist: int) -> int:
        last = 0
        ans = 0
        for now in rungs:
            ans += (now - last - 1) // dist
            last = now
        return ans


if __name__ == "__main__":
    print(Solution().addRungs(rungs=[1, 3, 5, 10], dist=2))  # 2
    print(Solution().addRungs(rungs=[3, 6, 8, 10], dist=3))  # 0
    print(Solution().addRungs(rungs=[3, 4, 6, 7], dist=2))  # 1
    print(Solution().addRungs(rungs=[5], dist=10))  # 0
